perm filename TST.LSP[206,LSP] blob
sn#309910 filedate 1977-10-07 generic text, type T, neo UTF8
; foo u ← foo1[u, NIL, NIL]
; foo1[u, atoms, nonatoms] ←
; if n u then reverse nonatoms * atoms
; else if at a u then foo1[d u, a u . atoms, nonatoms]
; else foo1[d u, atoms, a u . nonatoms]
; footwo u ← selectcar[u, ATOM] * selectcar[u, NOTATOM]
; selectcar[u, p] ←
; if n u then NIL
; else if p a u then a u . selectcar[d u, p]
; else selectcar[d u, p]
; notatom u ← ¬at u
; prod[u, v] ←
; if n u then NIL else polysum[scalprod[a u, v], 0 . prod[d u, v]]
; scalprod[s, l] ← if n l then NIL else times[s, a l] . scalprod[s, d l]
; polysum[u, v] ←
; if n u then v else if n v then u else a u + a v . polysum[d u, d v]
; elem1[e, l] ←
; if n l then e else if A = a l then a elem1[e, d l] else d elem1[e, d l]
; elem2[e, l] ←
; if n l then e else if A = a l then elem2[a e, d l] else elem2[d e, d l]
; locations[e, u] ← loc1[e, u, NIL]
; loc1[expr, space, path] ←
; if expr = space then <path>
; else if at space then NIL
; else loc1[expr, a space, A . path] * loc1[expr, d space, D . path]
; commons u ← commons1[collectsubexprs u, u, NIL]
; commons1[exprlist, u, results] ←
; if n exprlist then reverse results
; else commons1[
; d exprlist,
; u,
; if a exprlist ε d exprlist ∧ n assoc[a exprlist, results] then
; [a exprlist . locations[a exprlist, u]] . results
; else results]
; collectsubexprs u ←
; if at u then NIL
; else a u . collectsubexprs a u * d u . collectsubexprs d u
; commontwo u ← cummuns[commall[u, NIL], NIL]
; commall[u, path] ←
; if at u then <<u, path>>
; else <<u, path>> * commall[a u, A . path] * commall[d u, D . path]
; cummuns[biglist, results] ←
; if n biglist then results
; else if assoc[aa biglist, results] ∨ ¬assoc[aa biglist, d biglist] then
; cummuns[d biglist, results]
; else cummuns[
; d biglist, results * <aa biglist . collectall[aa biglist, biglist]>]
; collectall[expr, source] ←
; if n source then NIL
; else if expr = aa source then ada source . collectall[expr, d source]
; else collectall[expr, d source]